package com.fulihui.information.dto;

import org.near.toolkit.model.ToString;

import java.util.Date;

import static com.fulihui.information.dto.DateConv.d2s;
import static com.fulihui.information.dto.DateConv.s2d;

/**
 * 基础日期传输模型
 *
 * @author Willard.Hu on 2016/9/22 0022.
 */
public class AbstractDateDTO extends ToString {
    private static final long serialVersionUID = -8780976544316589711L;
    /**
     * 数据创建时间
     */
    protected long gmtCreate;
    /**
     * 数据修改时间
     */
    protected long gmtModified;

    public void gmtCreate(Date d) {
        this.gmtCreate = d2s(d);
    }

    public Date gmtCreate() {
        return s2d(this.gmtCreate);
    }

    public void gmtModified(Date d) {
        this.gmtModified = d2s(d);
    }

    public Date gmtModified() {
        return s2d(this.gmtModified);
    }

    public long getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtCreate(long gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public long getGmtModified() {
        return gmtModified;
    }

    public void setGmtModified(long gmtModified) {
        this.gmtModified = gmtModified;
    }
}
